package function

class Generic[T] {
  private val list:List[T]=Nil

}
object Generic{
  def main(args: Array[String]): Unit = {
    val shape = new Shape()
    val value = new Draw[Shape]()
    val value1 = new Draw[Rectangle]
    println(shape,value,value1)

  }
}
class Shape{

}
class Rectangle extends Shape{
  }
class Square extends Rectangle{

}
class Draw[T](){

}
class Demo{
  //泛型上限
  def fun1[T<:Shape](t:T)={

  }
  //下限
  def fun2[T>:Rectangle]={

  }
}
